@extends('Home.User.Common.layout')
@section('title')
    猎头下载资源设置_设置
@endsection
@section('content')
    <!--  content  -->
    <main class="common_content">
        <div class="container">
            <div class="ct_main">
                @include('Home.User.Set.Common.set_menu')
                <ul class="nav-items1 nav-items2 w999" id="tab-content2">
                    <!--基本设置-->
                    <li class="basic-sets active">
                        <div class="selector-head">
                            <h2>基本设置</h2>
                        </div>
                        <!--猎头下载资源设置-->
                        <ul class="basic-sets-ul">
                            <li>
                                <h2 class="basic-title">
                                    猎头下载资源设置
                                </h2>
                                <div class="layui-form">
                                    <table class="layui-table">
                                        <thead>
                                        <tr>
                                            <th>Id</th>
                                            <th>姓名</th>
                                            <th>职位</th>
                                            <th>剩余下载量</th>
                                            <th>已下载量</th>
                                            <th>操作</th>
                                        </tr>
                                        </thead>
                                        <tbody>
                                        @foreach($download_list as $item)
                                            <tr>
                                                <td>{{$item->uid}}</td>
                                                <td>{{$item->user?$item->user->username:''}}</td>
                                                @switch($item->level)
                                                    @case(1)
                                                    <td>经理</td>
                                                    @break

                                                    @case(2)
                                                    <td>主管</td>
                                                    @break


                                                    @case(3)
                                                    <td>职员</td>
                                                    @break

                                                    @default
                                                    <td>未知</td>
                                                @endswitch
                                                <td>{{$item->user?$item->user->download:0}}</td>
                                                <td>{{$item->user?$item->user->download_log_count:0}}</td>
                                                <td>
                                                    <input type="button" class="check-btn" value="下载记录"  onclick="open_button('{{route('download_user_list',$item->uid)}}','下载记录')">
                                                    <input type="button" class="check-btn" value="添加下载量"  onclick="open_button('{{route('download_edit',$item->uid)}}','添加下载量',600,300)">
                                                </td>
                                            </tr>
                                        @endforeach
                                        </tbody>
                                    </table>
                                </div>
                            </li>
                        </ul>
                    </li>
                </ul>
            </div>
        </div>
    </main>
@endsection